home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Informant Complete 1995 - 2000
/
Delphi Informant Complete 1995 to 2000.iso
/
Delphi Informant Magazine Complete Works SOURCE CODE 1998.rar
/
1998
/
Feb
/
di9802ts
/
Activscp.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-07-23
|
7KB
|
166 lines
unit Activscp;
interface
{ Interface specification for ActiveX Scripting }
Uses Windows, comobj, activeX;
{ IActiveScript.AddNamedItem input flags }
const
SCRIPTITEM_ISVISIBLE = $00000002;
SCRIPTITEM_ISSOURCE = $00000004;
SCRIPTITEM_GLOBALMEMBERS = $00000008;
SCRIPTITEM_ISPERSISTENT = $00000040;
SCRIPTITEM_CODEONLY = $00000200;
SCRIPTITEM_NOCODE = $00000400;
SCRIPTITEM_ALL_FLAGS = ( SCRIPTITEM_ISSOURCE +
SCRIPTITEM_ISVISIBLE +
SCRIPTITEM_ISPERSISTENT +
SCRIPTITEM_GLOBALMEMBERS +
SCRIPTITEM_NOCODE +
SCRIPTITEM_CODEONLY );
{ IActiveScript.AddTypeLib() input flags }
const
SCRIPTTYPELIB_ISCONTROL = $00000010;
SCRIPTTYPELIB_ISPERSISTENT = $00000040;
SCRIPTTYPELIB_ALL_FLAGS = (SCRIPTTYPELIB_ISCONTROL + SCRIPTTYPELIB_ISPERSISTENT);
{ IActiveScriptParse.AddScriptlet() and
IActiveScriptParse.ParseScriptText() input flags }
const
SCRIPTTEXT_NULL = $00000000; { added for demo}
SCRIPTTEXT_ISVISIBLE = $00000002;
SCRIPTTEXT_ISEXPRESSION = $00000020;
SCRIPTTEXT_ISPERSISTENT = $00000040;
SCRIPTTEXT_ALL_FLAGS = (SCRIPTTEXT_ISVISIBLE
+ SCRIPTTEXT_ISEXPRESSION
+ SCRIPTTEXT_ISPERSISTENT);
{ IActiveScriptSite.GetItemInfo() input flags }
const
SCRIPTINFO_IUNKNOWN = $00000001;
SCRIPTINFO_ITYPEINFO = $00000002;
SCRIPTINFO_ALL_FLAGS = (SCRIPTINFO_IUNKNOWN + SCRIPTINFO_ITYPEINFO);
{ IActiveScript.Interrupt() Flags }
const
SCRIPTINTERRUPT_DEBUG = $00000001;
SCRIPTINTERRUPT_RAISEEXCEPTION = $00000002;
SCRIPTINTERRUPT_ALL_FLAGS = (SCRIPTINTERRUPT_DEBUG
+ SCRIPTINTERRUPT_RAISEEXCEPTION);
{ script state enumerations}
type
SCRIPTSTATE = LongInt; {(0..5);}
const
SCRIPTSTATE_UNINITIALIZED = SCRIPTSTATE(0);
SCRIPTSTATE_INITIALIZED = SCRIPTSTATE(5);
SCRIPTSTATE_STARTED = SCRIPTSTATE(1);
SCRIPTSTATE_CONNECTED = SCRIPTSTATE(2);
SCRIPTSTATE_DISCONNECTED = SCRIPTSTATE(3);
SCRIPTSTATE_CLOSED = SCRIPTSTATE(4);
{ script thread state values }
type
SCRIPTTHREADSTATE = LongInt; {0..1}
Const
SCRIPTTHREADSTATE_NOTINSCRIPT = 0;
SCRIPTTHREADSTATE_RUNNING = 1;
{ thread IDs }
type SCRIPTTHREADID = DWORD;
const
SCRIPTTHREADID_CURRENT = SCRIPTTHREADID(-1);
SCRIPTTHREADID_BASE = SCRIPTTHREADID(-2);
SCRIPTTHREADID_ALL = SCRIPTTHREADID(-3);
{ GUID's }
const
{ Category ID's }
CATID_VBScript: TGUID = '{B54F3741-5B07-11CF-A4B0-00AA004A55E8}';
CATID_JScript: TGUID = '{F414C260-6AC0-11CF-B6D1-00AA00BBBB58}';
{ Class ID's }
IID_IActiveScriptParse: TGUID = '{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}';
IID_IActiveScriptSite: TGUID = '{DB01A1E3-A42B-11cf-8F20-00805F2CD064}';
IID_IActiveScriptSiteWindow: TGUID = '{D10F6761-83E9-11cF-8F20-00805F2CD064}';
{ String version of GUID's }
Class_IActiveScriptSite = '{DB01A1E3-A42B-11cf-8F20-00805F2CD064}';
Class_IActiveScriptSiteWindow = '{D10F6761-83E9-11cF-8F20-00805F2CD064}';
type
POleVariant = ^OleVariant;
IActiveScript = interface; { Forward declarations }
IActiveScriptParse = interface;
IActiveScriptSite = interface;
IActiveScriptSiteWindow = interface;
{ IActiveScript Interface - Methods in VTable order }
IActiveScript = Interface(IUnknown)
Function SetScriptSite(ScriptSite: IActiveScriptSite):HResult; stdcall;
Function GetScriptSite(const iid: TIID; out vObj):HResult; stdcall;
Function SetScriptState(ScriptState: LongInt):HResult; stdcall;
Function GetScriptState(out ScriptState: LongInt): HResult; stdcall;
Function Close:HResult; stdcall;
Function AddNamedItem(ItemName: WideString; dwFlags: DWord): HResult; stdcall;
Function AddTypeLib(const GuidTypeLib: TGUID; wVerMajor, wVerMinor, wFlags: Word):HResult; stdcall;
Function GetScriptDispatch(StrItemName: Pointer; out ScriptDispatch: IDispatch):HResult; stdcall;
Function GetCurrentScriptThreadID(wScriptThreadID: Word):HResult; stdcall;
Function GetScriptThreadState(wScriptThreadID, wScriptState: Word):HResult; stdcall;
Function InterruptScriptThread(wScriptThreadID: Word; ExcepInfo: PExcepInfo; wFlags: Word ):HResult; stdcall;
Function Clone(Script: iActiveScript):HResult; stdcall;
Function GetScriptThreadID(wWin32Thread, wScriptThreadID: Word):HResult; stdcall;
end;
{ IActiveScriptParse Interface - Methods in VTable order }
IActiveScriptParse = interface(IUnknown)
function InitNew: HResult; stdcall;
function AddScriptlet(DefaultName, ScriptCode, ItemName, SubItemName,
EventName, Delimiter: WideString; wSrcContextCookie: Word;
StartLine: Integer; wFlags: Word; StrName: WideString;
var ExcepInfo: TExcepInfo): Integer; stdcall;
function ParseScriptText(MainScript: WideString; ItemName: Pointer; UnkContext: IUnknown;
EndDelimiter: Pointer; dwSourceCookie: DWORD; StartLineNo: Integer;
dwFlags: DWord; var VarOut: OleVariant; var ExcepInfo: TExcepInfo): HResult; stdcall;
end;
{ IActiveScriptError Interface - Methods in VTable order }
IActiveScriptError = interface(IUnknown)
Function GetExceptionInfo(var excepInfo: TExcepInfo):HResult; stdcall;
Function GetSourcePosition(out wContextCookie: Word; out lineNo: UINT;
out charPos: Integer):HResult; stdcall;
Function GetSourceLineText(wsSourceLine: WideString):HResult; stdcall;
end;
{ IActiveScriptSite Interface - We are responsible for implementing this... }
IActiveScriptSite = interface(IUnknown)
[Class_IActiveScriptSite]
function GetLCID(var wLCID: TLCID): HResult; stdcall;
function GetItemInfo(StrName: WideString; dwReturnMask: DWord;
out UnkItem: IUnknown; out TypeInfo: ITypeInfo): HResult; stdcall;
function GetDocVersionString(var VersionString: TBSTR): HResult; stdcall;
function OnScriptTerminate(var VarResult: OleVariant; var ExcepInfo: TExcepInfo): HResult; stdcall;
function OnStateChange(ScriptState: LongInt): HResult; stdcall;
function OnScriptError(pAse: IActiveScriptError): HResult; stdcall;
function OnEnterScript: HResult; stdcall;
function OnLeaveScript: HResult; stdcall;
end;
{ IActiveScriptSiteWindow is aggregated into IActiveScriptSite }
IActiveScriptSiteWindow = interface(IUnknown)
[Class_IActiveScriptSiteWindow]
function GetWindow(var Hwnd: THandle): HResult; stdcall;
function EnableModeless(FEnable: WordBool): HResult; stdcall;
end;
implementation
end.